
{include file="public/same_header" /}

<!-- 右侧的开始 -->
<div class="right_bar jianchajilu hou_huanzheguanli">
    {include file="public/go_back" /}
    <div class="jcjl_detail">
        <div class="top_dec">
            <div>
                <span class="theme">{$breadcrumb}</span>

                <em><a href="{:url('patient/add_patient')}"  class="btn-permission" data-url="patient/add_patient" >新建患者</a></em>

            </div>
        </div>
        <div class="data">
            <form action="{:url('patient/index')}" method="get" ><!-- 下面是搜索  -->
            <div class="search_box">
                <!-- 开始日期 -->
                <div class="date_box start_date">
                    <script type="text/javascript">
                        $(function(){
                            $('.end_date_picker').date_input();
                        })
                    </script>
                    <div style="">
                        <input  type="text" class="end_date_picker"  name="start" value="{$search['start']?? ''}"  id="start_date">
                    </div>
                    <script>
                        //创建一个当前日期对象
                        var now = new Date();
                        //格式化日，如果小于9，前面补0
                        var day = ("0" + now.getDate()).slice(-2);
                        //格式化月，如果小于9，前面补0
                        var month = ("0" + (now.getMonth() + 1)).slice(-2);
                        //拼装完整日期格式
                        var today = now.getFullYear()+"-"+(month)+"-"+(day) ;
                        //完成赋值
                      //  $('#start_date').val(today);
                    </script>
                </div>
                <!-- 开始的日期结束 -->

                <!-- 结束日期 -->
                <div class="date_box end_date">
                    <script type="text/javascript">
                        $(function(){
                            $('.end_date_picker').date_input();
                        })
                    </script>
                    <div style="">
                        <input  type="text" class="end_date_picker"  name="end" value="{$search['end']?? ''}"  id="end_date">
                    </div>
                    <script>
                        //创建一个当前日期对象
                        var now = new Date();
                        //格式化日，如果小于9，前面补0
                        var day = ("0" + now.getDate()).slice(-2);
                        //格式化月，如果小于9，前面补0
                        var month = ("0" + (now.getMonth() + 1)).slice(-2);
                        //拼装完整日期格式
                        var today = now.getFullYear()+"-"+(month)+"-"+(day) ;
                        //完成赋值
                        //$('#end_date').val(today);
                    </script>
                </div>
                <!-- 结束的日期结束 -->
                <!-- 输入  查找姓名 -->
                <div class="search_by_name" style="overflow: hidden">
                    <input type="text"  name ="name" value="{$search['name']?? ''}" placeholder="查找姓名或身份证">
                    <button type="submit" value="搜索" class="sou_btn">搜索</button>
                </div>

            </div>
                </form>
            <!-- 日历的输入  开始 -->
            <!-- 下面的   列表 开始  -->
            {if condition="!$list->isEmpty()"}
            <div class="liebiao">

                <div class="liebiao_dec">
                    <div class="liebiao_top">
                        <strong class="first">姓名</strong>
                        <strong class="second">性别</strong>
                        <strong class="third">身份证号</strong>
                        <strong class="forth">年龄</strong>
                        <strong class="fifth">检查记录</strong>
                        <strong class="sixth">检查时间</strong>
                    </div>
                    <ul>

                        {foreach $list as $patient}
                        <li>
                            <a href="{:url('patient/patient_info',array('pid'=>$patient['id']))}">
							<span class="first">
								<em>{$patient['name']}</em>
							</span>
                                <span class="second">{$patient['sex']|get_sex_str}</span>
                                <span class="third">{$patient['document_num']}</span>
                                <span class="forth">{$patient['birth']|getAge}岁</span>
                                <span class="fifth">共{$patient['record_count']}条检查记录</span>
                                <span class="sixth">{$patient['create_time']|}</span>
                            </a>
                        </li>

                        {/foreach}



                    </ul>
                </div>
            </div>
            <!-- 列表的结束 -->

            {include file="public/page" /}
            {else/}
            暂无记录
            {/if}
        </div>
    </div>
</div>
<!-- 右侧的结束 -->
</div>
</div>

{include file="public/footer" /}